<%
 @task = task
 @user = user
 @project = project
 if(task.done==1); donestr = "done"; else; donestr=''; end
 if(task.star==1); starstr = "on"; else; starstr='off'; end
-%>
<table style="border:1px solid #AAF;background: #EEF;">
<tr><td>Done:</td><td><%= check_box(:task, :done,  {:onfocus => "mover('d')", :onmouseover => "mover('d')", :onchange => "change('#{task.id}',event);", :class => donestr, :id => "d#{task.id}"}) %></td></tr>
<tr><td>Project:</td><td><%=text_field(:project, :name, {:onfocus => "mover('p')",:onmouseover => "mover('p')",:size => 10, :onkeyup => "change('#{task.id}',event);", :class => donestr, :id => "p#{task.id}"}) %></td></tr>
<tr><td>Priority:</td><td><%=text_field(:task, :priority, {:onfocus => "mover('pr')",:onmouseover => "mover('pr',this.value)",:size => 1,  :onkeyup => "change('#{task.id}',event);", :class => donestr, :id => "pr#{task.id}"}) %></td></tr>
<tr><td>Task:</td><td><%=text_area(:task, :title, {:onfocus => "mover('t')",:onmouseover => "mover('t',this.value)",:cols => 60, :rows => 4, :onkeyup => "change('#{task.id}',event);", :class => donestr, :id => "t#{task.id}"}) %></td></tr>
<tr><td>Assigned:</td><td><%=text_field(:user, :name, {:onfocus => "mover('r')",:onmouseover => "mover('r')",:size => 10, :onkeyup => "change('#{task.id}',event);", :class => donestr, :id => "r#{task.id}"}) %></td></tr>
<tr><td>Deadline:</td><td><%=text_field(:task, :duedate, {:onfocus => "dispcal('#{task.id}',this.value);",:onmouseover => "mover('da')",:size => 10,:onkeyup => "change('#{task.id}',event);", :class => donestr, :id => "da#{task.id}"}) %></td></tr>
<tr><td></td><td>
<a href="#" onmouseover="mover('s')" onclick="save('<%=task.id%>');return false;"><img id="s<%=task.id%>" src="/images/save.png" border="0"></a>
<a href="#" onmouseover="mover('n')" onclick="notes(<%=task.id%>);return false;"><img id="n<%=task.id%>" src="/images/notes.png" border="0"></a>
<a href="#" onmouseover="mover('de')" onclick="del(<%=task.id%>);return false;"><img id="de<%=task.id%>" src="/images/delete.gif" border="0"></a>
<div style="display:inline" id="deadline<%=task.id%>">
<%= render(:partial => 'deadline', :locals => {:task=>task}) %>
</div>
<% if(task.notes_count > 0) -%>
(<%= task.notes_count -%> notes)
<% end -%>
<div class="tags" id="tag<%=task.id%>"><%=task.tags.map{|t| t.name }.join(", ")%></div>
<div id="done_on_<%=task.id%>" class="done_on"><% if task.done_on %>done <%= time_ago_in_words(task.done_on) %> ago<% end %></div>
</td></tr>
</table>
<script>$('t<%=task.id%>').focus();</script>
